<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

@Require
<link rel="stylesheet" href="/resources/styles/form.css" type="text/css"></link>

@Require
<script type="text/javascript" src="/resources/scripts/admin.js"></script>

@Require
<script type="text/javascript"
	src="/resources/ckeditor/ckeditor_basic.js"></script>

@Require
<script type="text/javascript">
	CKEDITOR.editorConfig = function( config )
	{
	    config.uiColor = '#AADC6E';
	    config.basePath = "/resources/ckeditor";
	    config.toolbar = 'MyToolbar';
		config.toolbar_MyToolbar =
		[
			{ name: 'document', items : [ 'NewPage','Preview' ] },
			{ name: 'clipboard', items : [ 'Cut','Copy','Paste','PasteText','PasteFromWord','-','Undo','Redo' ] },
			{ name: 'editing', items : [ 'Find','Replace','-','SelectAll','-','Scayt' ] },
			{ name: 'insert', items : [ 'Image','Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak','Iframe' ] },
	                '/',
			{ name: 'styles', items : [ 'Styles','Format' ] },
			{ name: 'basicstyles', items : [ 'Bold','Italic','Strike','-','RemoveFormat' ] },
			{ name: 'paragraph', items : [ 'NumberedList','BulletedList','-','Outdent','Indent','-','Blockquote' ] },
			{ name: 'links', items : [ 'Link','Unlink','Anchor' ] },
			{ name: 'tools', items : [ 'Maximize','-','About' ] }
		];
	};


	jQuery(initBlogEntryForm);

	function saveBlogEntry() {
		jQuery("#blogEntryForm").submit();
	
		return false;
	}
</script>

</head>

<body>
	@Header(title="Welcome!")
	<div></div>

	@ShowIf(adminUser)
	<div id="infobox">
		<div id="page">
			<h2>Blog Entry</h2>

			<form method="post" id="blogEntryForm">
				<input type="hidden" name="entry.id" value="${entry.id}" />

				<p>
					<label for="title">Title</label> <input type="text" id="title"
						name="entry.title" value="${entry.title}" />
				</p>

				<p>
					<label for="imageURL">Image URL</label> <input type="text"
						id="imageURL" name="entry.imageURL" value="${entry.imageURL}" />
				</p>

				<p>
					<label for="teaser">Teaser</label> <input type="text" id="teaser"
						name="entry.teaser" value="${entry.teaser}" />
				</p>

				<p>
					<label for="skipHomePage">Skip Home Page</label>
					@ShowIf(entry.skipHomePage) <input type="checkbox"
						id="skipHomePage" name="entry.skipHomePage" value="true" checked />

					@ShowIf(!entry.skipHomePage) <input type="checkbox"
						id="skipHomePage" name="entry.skipHomePage" value="true" />
				</p>


				<p>
					<label for="text">Text</label>
					<textarea id="text" name="entry.text" class="ckeditor">${entry.text}</textarea>
				</p>

				<p>
					<label>&nbsp;</label> <a href="/admin/blogEntry" class="button"
						onclick="return saveBlogEntry();">Save Entry</a> <a href="/admin/"
						class="button">Cancel</a>
				</p>
			</form>

		</div>
		<!--/page -->
		<div class="clear"></div>
	</div>
	<!--/infobox -->

	@Footer
	<div></div>
</body>
</html>